package com.xx.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class SpringMvcSupport extends WebMvcConfigurationSupport {
    public SpringMvcSupport(){
        System.out.println("过滤器启动...");
    }
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry){
        //当前访问/static/???下的路径时不要走mvc
        registry.addResourceHandler("/css/**").addResourceLocations("/css/");
        registry.addResourceHandler("/static/**").addResourceLocations("/static/");
        registry.addResourceHandler("/js/**").addResourceLocations("/js/");
        registry.addResourceHandler("/pages/**").addResourceLocations("/pages/");
        registry.addResourceHandler("/plugins/**").addResourceLocations("/plugins/");
    }
}
